<template>
  <button
    :method="method"
    :class="{ current: method === curMethod }"
    @click="changeMethod"
  >
    {{ innerText }}
  </button>
</template>

<script>
export default {
  name: "CalButton",
  props: {
    curMethod: String,
    innerText: String,
    method: String,
  },
  methods: {
    changeMethod() {
      this.$emit("dispatch", "CHANGE_METHOD", this.method);
    },
  },
};
</script>

<style lang="scss" scoped>
.current {
  background-color: orange;
  color: #fff;
}
</style>